<?php
// Prevenir que jquery se cargue dos veces
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
Util::tsRegisterAssetJs('_form_quick_modal.js');
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'horizontal',
    'id' => 'telefono-form',
    'enableAjaxValidation' => false,
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
    'enableClientValidation' => true,
    'focus' => array($model, 'numero'),
        ));
?>
<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h4><i class="icon-phone"></i> Registrar Telefono</h4>
</div>
<div class="modal-body">
    <input id="isNewRecord" value="<?php echo $model->isNewRecord ? 1 : 0 ?>" type="hidden">
    <?php echo $form->textFieldRow($model, 'numero', array('maxlength' => 25, 'class' => 'telefono')) ?>
    <?php echo $form->dropDownListRow($model, 'id_operadora', array('' => ' -- Seleccione -- ') + CHtml::listData(TipoOperadora::model()->findAll(), 'id_operadora', TipoOperadora::representingColumn())) ?>
</div>

<div class="modal-footer">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'type' => 'success',
        'icon' => 'ok',
        'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        'htmlOptions' => array(
            'onClick' => 'js:saveTelefono("#telefono-form")')
    ));
    ?>
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'icon' => 'remove',
        'label' => Yii::t('AweCrud.app', 'Cancel'),
        'htmlOptions' => array(
            'data-dismiss' => 'modal',)
    ));
    ?>
</div>
<?php $this->endWidget(); ?>

